package com.example.shoppingmall.service;

import com.example.shoppingmall.dao.PictureMapper;
import com.example.shoppingmall.pojo.Picture;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PictureService {

    @Autowired
    PictureMapper pictureMapper;

    //多条件模糊查询+分页
    public List<Picture> picList(Integer pic_ID, String pic_name,
                                 Integer pageNo, Integer pageNum){
        return pictureMapper.picList(pic_ID, pic_name, pageNo, pageNum);
    }

    //查询总条数
    public int total(Integer pic_ID,String pic_name){
        return pictureMapper.total(pic_ID, pic_name);
    }

    //修改
    public int update(Picture picture){
        return pictureMapper.update(picture);
    }

    //根据用户的头像新增图片
    public int add(Picture picture){
        return pictureMapper.add(picture);
    }

}
